<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/style.css" />
    <script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/ckform.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="<?php echo U('index');?>" method="post">
   <button type="button" class="btn btn-success" onClick="adduser();" id="addnew">新增概率</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>id</th>
        <th>项目id</th>
        <th>奖品名</th>
        <th>中奖范围</th>
        <th>中奖范围</th>
        <th>月中奖次数</th>
        <th>日中奖次数</th>
        <th>发券(没有为空)</th>
        <th>相关操作</th>
    </tr>
    </thead>
    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><?php echo ($vo["id"]); ?></td>
            <td><?php echo ($vo["projectid"]); ?></td>
            <td><?php echo ($vo["name"]); ?></td>
            <td><?php echo ($vo["start_gailv"]); ?></td>
            <td><?php echo ($vo["end_gailv"]); ?></td>
            <td><?php echo ($vo["yuegailv"]); ?></td>
            <td><?php echo ($vo["rigailv"]); ?></td>
            <td><?php echo ($vo["quan"]); ?></td>
            <td>
                <a href="<?php echo U('Activity/gailvbianji');?>?projectid=<?php echo ($vo["projectid"]); ?>&id=<?php echo ($vo["id"]); ?>">编辑</a>
                <a onclick="del('<?php echo ($vo["id"]); ?>')" >删除</a>
            </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>
</body>
</html>
<script>
    function adduser(){
        window.location.href="<?php echo U('Activity/addgailv');?>?project=<?php echo ($project); ?>";
    }

    function del(id)
    {
        if(confirm("确定要删除吗？"))
        {
            var url = "<?php echo U('Activity/deletegailv');?>?id="+id;
            window.location.href=url;
        }
    }
</script>